;--------------------------------------
;
; vidInit.asm
;
; initializes video structure
;

;--------------------------------------
;
; include defs, prototypes and macros
;

include tab6.inc

;--------------------------------------
;
; begin code segment
;

	.Code

;--------------------------------------
;
; initialize video structure
;


vidInit PROC Pascal PUBLIC USES ds 
IF mdl eq 3
	mov	ax,SEG scrn_seg
	mov	ds,ax
ENDIF	
		
	xor	cx,cx                ; CX -> 0
	mov	AH,15                ; get video mode
	int	10h                  ; via BIOS int
	.IF	(al==7)              ; is mono mode?
	mov	ds:scrn_seg,0b000h   ; mono scrn seg
	ret   	                     ; return to caller
	.ENDIF
	.IF	(bh==0)              ; is video page 0?
	mov	ds:[scrn_seg],0b800h ; set page 0 segment
	.ELSEIF (bh==1)              ; is video page 1?
	mov	ds:scrn_seg,0b900h   ; set page 0 segment
	.ELSEIF (bh==2)              ; is video page 1?
	mov	ds:scrn_seg,0ba00h   ; set page 0 segment
	.ELSEIF (bh==3)              ; is video page 1?
	mov	ds:scrn_seg,0bb00h   ; set page 0 segment
	.ENDIF                      
	ret   	                     ; return to caller

vidInit ENDP

	END
;
;--------------------------------------
